[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
floor() Calculate Floor of Value
#include <math.h>
double floor(x);
double x; Floating-point value
floor() returns the largest double value integer that is less than or
equal to 'x'.
Returns: Largest integer <= 'x'. There is no error return.
-------------------------------- Example ---------------------------------
The following statements calculate the floor of 3.3, 0.0 and -3.3.
#include <math.h> /* Required for function definition only */
main()
{
double x, y, z;
x = floor(3.3); /* x = 3.0 */
y = floor(0.0); /* y = 0.0 */
z = floor(-3.3); /* z = -4.0 */
}
See Also:
ceil()
fmod()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson